package com.it.a02oopextendsdemo2;

public class Test {
    public static void main(String[] args) {
        //利用空参结构创建了类对象
        Zi z1 = new Zi();

        //利用带参构造创建子类对象
        //报错 Zi z2 = new Zi("zhangsan",23);
    }
}

class Fu{
    String name;
    int age;

    public Fu(){}
    public Fu(String name, int age){
        this.name = name;
        this.age = age;
    }
}

class Zi extends Fu{
    //如果一个类没有构造方法，虚拟机会自动给你添加一个默认的空参构造
}
